<?php
/**
 * 话题----热门话题旁边的----分类
 */
require_once dirname(dirname(__DIR__))."/common.php";
use app\cls\tom\Response;
use app\cls\tom\SysResource;
use app\model\UserMaterial;
//实例化数据库
$db = SysResource::getDB(false);
$UserMaterial = new UserMaterial($db);
$da1=$UserMaterial->dub_fenlie();
if(!empty($da1)){
    foreach($da1 as $k=>$v){
        $re=$UserMaterial->ones("user_material","id",['examine'=>3,"mix_status"=>1,"del1"=>2,"join_type"=>$v['id']]);
        if(empty($re)){
            unset($da1[$k]);
        }
    }
    $da2=[];
    foreach($da1 as $kk=>$vv){
        $da2[]=$vv;
    }
    Response::output(0,"查询成功",$da2);
}else{
    Response::output(0,"查询成功",[]);
}
